configure: error: Cannot find header files under /usr

chris (2007-02-09 17:24:42)
5076 views
0 replies
When compiling PHP with mysql support, this error might be spat out by the ./configure script. The reason for this is that the system is unable to find your mysql headers (required to compile php\'s mysql extension). To figure out where your mysql headers are, search the system for mysql.h :

$ updatedb # first update your locate databae
$ locate mysql.h # find out where the mysql.h resides.

On my system, the result looks like this:

$ root@baikal:~# locate mysql.h
/usr/src/mysql-standard-5.0.27-linux-i686-glibc23/include/mysql.h
/usr/src/php-5.2.0/ext/mysql/php_mysql.h
/usr/src/php-5.2.0/ext/pdo_mysql/php_pdo_mysql.h

So it seems that my mysql.h is under /usr/src/mysql-standard-5.0.27-linux-i686-glibc23/include/mysql.h. I happen to know that I have a symbolic link from /usr/src/mysql-standard-5.0.27-linux-i686-glibc23 to /usr/local/mysql, so I need to pass this into the configure script like this:

$ make clean && ./configure --with-apxs=/usr/sbin/apxs --with-mysql=/usr/local/mysql

and sure enough, this completes just fine.


hth


christo
comment